#ifndef _ADDRESS_TABLE_H_
#define _ADDRESS_TABLE_H_


/*
	class : AddressTable
	desc : This is a class that creates
	a table of memory addresses and does
	just that. This is more for the case where
	I want to store the addresses of unrelated/related
	 objects together so I use void* to do it and 
	then get back the value of that cell to set. Can be used
	to implement virtual functionality when virtual functionality
	is not available at all. This will probably get converted to
	c since it might be more useful in providing c like functionality
*/
template<int N>
class AddressTable
{
	private : 
		//create a table of N addresses.
		void* table[N];
	public :
		AddressTable(){};
		
		template<typename Value>
		Value*& get(unsigned int i)
		{	return (&((Value*) table[i]));	}
		
		template<typename Value>
		void set(unsigned int i, Value* v)
		{
			table[i] = (void*) v;
		}
		template<typename Value>
		Value*& operator[](unsigned int i)
		{	return get(i);	}
};


#endif
